package com.reggie.service.impl;

import com.reggie.mapper.SetmealDishMapper;
import com.reggie.pojo.SetmealDish;
import com.reggie.service.SetmealDishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SetmealDishServiceImpl implements SetmealDishService {
    @Autowired
    SetmealDishMapper setmealDishMapper;

    @Override
    public boolean add(SetmealDish setmealDish) {
        if (setmealDishMapper.add(setmealDish)==1) return true;
        return false;
    }

    @Override
    public List<SetmealDish> find(Long setmealId) {
        List<SetmealDish> setmealDishList = setmealDishMapper.find(setmealId);
        return setmealDishList;
    }

    @Override
    public boolean delete(Long id, Long userId) {
        if (setmealDishMapper.delete(id, userId)==1) return true;
        return false;
    }

}
